<script src="<?php echo RESOURCE_SITE_URL;?>/js/area_array.js"></script>
<script src="<?php echo RESOURCE_SITE_URL;?>/js/jquery-ui/jquery.ui.js"></script>
<script src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.validation.min.js"></script>
<script src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.masonry.js"></script>
<script src="<?php echo RESOURCE_SITE_URL;?>/js/dialog/dialog.js" id="dialog_js" charset="utf-8"></script>
<!--当前位置 start-->
<div class="block">
    <div id="ur_here">
        <img src="/public/src/images/category_icon.gif"/>&nbsp;当前位置：
        <?php $navLink = array();
        foreach ($output['nav_link_list'] as $item) { ?>
            <?php if (!empty($item['link'])) {
                $navLink[] = '<a href="' . $item['link'] . '">' . $item['title'] . '</a>';
            } else {
                $navLink[] = $item['title'];
            } ?>
        <? }
        echo implode(' &gt; ', $navLink); ?>
    </div>
</div>
<!--当前位置 end-->
<div style="margin:0 auto; width:1000px; height:787px; overflow:hidden; font-family:'微软雅黑', Arial; font-size:14px; background:url(/public/src/images/jiameng_bg.jpg) no-repeat center;">
    <script language="javascript">
        function checkSubmit()
        {
            var f = document.getElementById("jiameng");
            if(f.username.value=="" || f.tel.value=="" || f.email.value=="" || f.qq.value=="" || f.address=="" || f.prcysj.value=="" || f.chacysj.value=="" || f.jmdz.value=="" || f.mj.value=="" || f.liaojie=="" || f.jyjh.value==""|| f.name.value.length==0|| f.province.value.length==0|| f.city.value.length==0)
            {
                alert("所有内容都必须填写完整");
                return false;
            }
        }
    </script>
    <form action="<?php echo urlShop('franchiser','apply');?>" method="post" name="jiameng" id="jiameng">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top:230px;">
            <tr>
                <td colspan="4" align="center" height="80"><img src="/public/src/images/jiamengb.png"  /></td>
            </tr>
            <tr>
                <td width="29%" height="35" align="right">申请人姓名:</td>
                <td width="20%" height="28"><label for="name"></label>
                    <input type="text" name="username" id="username" /></td>
                <td width="14%" height="28" align="right">移动电话:</td>
                <td width="37%" height="28"><input type="text" name="tel" id="tel" /></td>
            </tr>
            <tr>
                <td height="35" align="right">E-mail:</td>
                <td height="28"><label for="email"></label>
                    <input type="text" name="email" id="email" /></td>
                <td height="28" align="right">QQ:</td>
                <td height="28"><input type="text" name="qq" id="qq" /></td>
            </tr>
            <tr>
                <td height="35" align="right">地址:</td>
                <td height="28"><input type="text" name="address" id="address" /></td>
                <td height="28" align="right">普洱茶从业时间:</td>
                <td height="28"><input type="text" name="prcysj" id="prcysj" /></td>
            </tr>
            <tr>
                <td height="35" align="right">茶行业从业时间:</td>
                <td height="28"><input type="text" name="chacysj" id="chacysj" /></td>
                <td height="28" align="right">申请加盟区域:</td>
                <td height="28">
                    <select name="province" id="search-province" class="search-form-province">
                        <option value="">请选择省份</option>
                    </select>
                    <select name="city" id="search-city" class="search-form-city"></select>
                </td>
            </tr>
            <tr>
                <td height="55" align="right">曾经营和现经营产品:</td>
                <td height="28" colspan="3"><label for="jycp">
                        <textarea name="jycp" cols="73" id="jycp"></textarea>
                    </label></td>
            </tr>
            <tr>
                <td height="55" align="right">加盟店地址:</td>
                <td height="28" colspan="3"><textarea name="jmdz" cols="73" id="jmdz"></textarea></td>
            </tr>
            <tr>
                <td height="35" align="right">加盟店面积:</td>
                <td height="28" ><input type="text" name="mj" id="mj" /></td>
                <td height="35" align="right">店名:</td>
                <td height="28" ><input type="text" name="name" id="name" /></td>
            </tr>
            <tr>
                <td height="55" align="right">您对书剑江湖的了解情况:</td>
                <td height="28" colspan="3"><textarea name="liaojie" cols="73" id="liaojie"></textarea></td>
            </tr>
            <tr>
                <td height="65" align="right">加盟店经营计划:</td>
                <td height="28" colspan="3"><textarea name="jyjh" cols="73" rows="3" id="jyjh"></textarea></td>
            </tr>
            <tr>
                <td height="35" colspan="4" align="center">
                    <?php Security::getToken();?>
                    <input name="act" type="hidden" value="submitjiameng" /><input type="submit" name="submit" id="submit" value=" " style=" cursor:pointer;background:url(/public/src/images/tijiao.png) no-repeat; width:103px; height:33px; border:0;" /></td>
            </tr>
        </table>
    </form>
</div>
<div class="blank"></div>
<script type="text/javascript">
    $(function(){
        //初始化地区
        function initArea(parentId){
            var province='';
            $.each(nc_a[parentId],function(_i,_item){
                if(_item[1]=='海外')return;
                province+='<option value="'+_item[0]+'">'+_item[1]+'</option>';
            });
            return province;
        }
        function initCity(provinceId){
            $('#search-city').html('<option value="">请选择城市</option>'+initArea(provinceId));
        }
        $('#search-province').append(initArea(0)).bind('change',function(){
            initCity($(this).val());
        });
        initCity(nc_a[0][0][0]);
        var applyForm=$("#jiameng");
        $("#submit").bind('click',function(){
            return checkSubmit();
        });
        applyForm.bind('submit',checkSubmit);
    });
</script>